<?php
$keyword = $this->request->getParam('keyword');
$country = $this->request->getParam('country');
$zipcode = $this->request->getParam('zipcode');
$address = $this->request->getParam('address');
$location = $this->request->getParam('location');
$radius = $this->request->getParam('radius');
?>
<div class="search-box">
	<form id="front_search_form" action="<?php echo $this->action; ?>">
		<input type="text" name="keyword"
			value="<?php echo isset($keyword) ? $keyword : $this->translate->_('Search...'); ?>"
			label="<?php echo $this->translate->_('Search...'); ?>" /> <input
			type="submit" class="search_submit" value="" />
		<div class="clear"></div>
	</form>
</div>
<div class="search-more">
	<a href="javascript:void(0);" class="rreset"><?php echo $this->translate->_("Reset"); ?></a>
	<a href="javascript:void(0);"
		hide="<?php echo $this->translate->_("Close search options"); ?>"
		show="<?php echo $this->translate->_("More search options"); ?>"
		class="mmore">
		<?php echo $this->translate->_("More search options"); ?></a>
	<div class="advanced-search">
		<div class="nub"></div>
		<?php
// countries
$scountry = "<option value=''> " . $this->translate->_('Select Country') . "</option>";
foreach ($this->country_list as $id => $val)
{
    $sel = $country && $country == $id ? 'selected="selected"' : null;
    $scountry .= "<option value='{$id}' {$sel}>{$val}</option>";
}

// figure out radius
$sradius = "<option value=''> " . $this->translate->_('Select Radius') . "</option>";
;
foreach (range(10, 50, 10) as $range)
{
    $sel = $radius && $radius == $range ? 'selected="selected"' : null;
    $sradius .= "<option value='{$range}' {$sel}>{$range} km</option>";
}
?>
		<form id="advanced_search_form" action="<?php echo $this->action; ?>">
			<table width="100%" cellspacing="5" cellpadding="5" border="0">
				<tr>
					<td><label><?php echo $this->translate->_("Country"); ?></label></td>
					<td style='padding-left: 5px;'><select name='country'><?php echo $scountry; ?></select></td>
				</tr>
				<tr>
					<td><label><?php echo $this->translate->_("Zipcode"); ?></label></td>
					<td style='padding-left: 5px;'><input type='text' name='zipcode'
						value='<?php echo $zipcode; ?>' /></td>
				</tr>
				<tr>
					<td><label><?php echo $this->translate->_("Address"); ?></label></td>
					<td style='padding-left: 5px;'><input type='text' name='address'
						value='<?php echo $address; ?>' /></td>
				</tr>
				<tr>
					<td><label><?php echo $this->translate->_("City"); ?></label></td>
					<td style='padding-left: 5px;'><input type='text' name='location'
						value='<?php echo $location; ?>' /></td>
				</tr>
				<!-- 
				<tr>
					<td><label><?php echo $this->translate->_("Radius"); ?></label></td>
					<td style='padding-left: 5px;'><select name='radius'><?php echo $sradius; ?></select></td>
				</tr>
				-->
				<tr>
					<td colspan="2"><input class="submit" style="float: right;"
						type="button" id="search_reset"
						value="<?php echo $this->translate->_("Reset"); ?>" /> <input
						class="submit" style="float: right;" type="submit"
						value="<?php echo $this->translate->_("Go"); ?>" /></td>
				</tr>
			</table>
		</form>
		<script type="text/javascript" src="/js/search.js"></script>
	</div>
</div>
